<template>
  <div class="coming">
    <div class="shoppinglist" v-for="(item, index) in list" :key="index">
      <div class="img-box">
        <img :src="item.picture" alt="" />
      </div>
      <div class="text">
        <div class="dizhi">{{item.id}}</div>
        <div>{{item.name}}</div>
        <div class="tuan">爆爆团价</div>
        <div class="box">
          <div class="left">
            <div class="price">￥{{item.min_price}} <span v-if="item.promotion_info">{{item.promotion_info}}</span></div>
            <div class="yuanjia"><s>￥{{item.min_price-index}}</s></div>
          </div>
          <div class="right">
            <div class="btn">马上抢</div>
            <div class="saled">已售{{item.month_saled_content}}件</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
    data(){
        return{
            list:[
            ]
        }
    },
    mounted() {
      document.title = this.$route.meta.title
    //发请求
    axios
      .get("/api/tuan/list", { 
        headers: { Authorization: "Bearer " + localStorage.getItem("token") },params:{status:1}
  })
      .then((res) => {
        console.log(res.data);
        this.list=res.data.list
      });
  },
};
</script>
<style lang="scss" scoped>
.coming {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 10px;
  margin: 5px 10px;
  // padding: 5px 10px;
  .shoppinglist {
    padding: 5px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    .img-box {
      width: 40%;
      margin-right: 10px;
     
      img {
        width: 100%;
       
      }
    }
    .text {
        width: 60%;
      .dizhi {
        font-size: 12px;
        color: rgb(176, 173, 173);
        margin-bottom: 10px;
      }
      .tuan {
        margin: 10px 0;
        color: red;
        font-size: 12px;
      }
      .box {
        display: flex;
        justify-content: space-between;
        .left {
          .price {
            font-size: 18px;
            color: red;
            span {
              font-size: 14px;
              padding: 2px 5px;
              display: inline-block;
              border: 1px solid red;
            }
          }
          .yuanjia {
            font-size: 12px;
            color: rgb(176, 173, 173);
          }
        }
        .right {
          .btn {
            padding: 2px 10px;
            background-color: red;
            color: white;
            font-weight: bold;
            border-radius: 20px;
            text-align: center;
          }
          .saled {
            font-size: 12px;
            color: red;
            text-align: center;
          }
        }
      }
    }
  }
}
</style>